package 笔试真题;

import java.util.ArrayList;
import java.util.List;



public class Qianxin3 {
    private static int ans = 1<<30;
    public static void main(String[] args) {
    }
    public int getMinLength (int[][] pearls) {
        int max = 0;
        for (int[] pearl : pearls) {
            max = Math.max(Math.max(pearl[0],pearl[1]),max);
        }

        boolean[][] graph = new boolean[max+1][max+1];
        boolean[][] visited = new boolean[max+1][max+1];
        for (int[] pearl : pearls) {
            graph[pearl[0]][pearl[1]] = true;
        }
        bfs(graph,visited,new ArrayList<Integer>(),pearls[0][0],pearls[0][1]);
        // write code here
        return 0;
    }

    private void bfs(boolean[][] graph, boolean[][] visited, List<Integer> list, int i, int j) {
        // list 线段的长度，最后是两条
        if(visited[i][j]) return;
        if(list.size()==3){
            list.remove(0);
            int he = list.get(0) +list.get(1);
            ans = Math.min(he,ans);
        }
        for (int k = 0; k < graph[i].length; k++) {
        }

    }

}
